package net.tv90.bfmccoreqqbot;

import net.tv90.bfmccoreqqbot.api.CommandBasedMessageDispatcher;
import net.tv90.bfmccoreqqbot.api.WebSocketClientInitializer;
import net.tv90.bfmccoreqqbot.api.handler.*;
import net.tv90.bfmccoreqqbot.api.interceptor.QqGroupInterceptor;

public class ApplicationContext extends WebSocketClientInitializer {

    //注册处理器
    static {
        messageDispatcher = new CommandBasedMessageDispatcher();
        messageDispatcher.registerHandler("74M，你好", HelloHandler.class);
        messageDispatcher.registerHandler("查服", ServerInfoMessageHandler.class);
        messageDispatcher.registerHandler("清除冷却", ClearCoolDownMessageHandler.class);
        messageDispatcher.registerHandler("玩家信息", PlayerStatsMessageHandler.class);
        messageDispatcher.registerHandler("执行命令", CommandExecutorMessageHandler.class);
        messageDispatcher.registerHandler("查询武器", WeaponInfoMessageHandler.class);
        messageDispatcher.registerHandler("bf4", BF4StatsMessageHandler.class);
        messageDispatcher.registerHandler("sjh", QueryTelephoneMessageHandler.class);
//        messageDispatcher = new AnnotationBasedMessageDispatcher();
//        ((AnnotationBasedMessageDispatcher) messageDispatcher).registerHandlersFromPackage("net.tv90.bfmccore.api.handler");
    }

    //注册拦截器
    static {
        messageDispatcher.registerInterceptor(new QqGroupInterceptor());
    }

}
